Item Properties - Triggers Page

Originally, PTFB Pro would only trigger a single-press or macro when a matching target window appeared. Following helpful feedback from our users, PTFB now offers a range of flexible triggering options, described below.

Always remember that the "master switch" is still on PTFB's main page. If you disable an item there, it won't trigger under any circumstances - regardless of what trigger options are set on this page.

Trigger When Target Window Appears (on by default)

This is the most commonly used trigger option, and is on by default. The following sub-options are available:

Initial Delay (default 1 sec)

When a target window appears, PTFB will wait for the prescribed period before taking action, and put a red border around its tray icon to indicate that a countdown is in progress.

The default delay is 1 second - this is partly for safety, and partly to let you know whether PTFB recognizes a target or not (helpful while you're still finding your way around PTFB's window identification features). If you want PTFB to handle the target window immediately, just change the delay to 0 secs.

Note that you can specify the delay down to a granularity of tenths of a second. This can be handy in the following cases:

Limit to Specific Hours (default off, all hours selected)

You can limit the "on appearance" trigger to certain hours of the day. For example, you can set an item to trigger only after your hours of work, or only during lunchtimes etc.

Limit to Specific Days (default off, all days selected)

You can further limit the trigger to specific days if required.

 

Other Triggers

The following additional trigger options are available.

By Schedule (default off)

PTFB has its own scheduling option, similar Windows' own inbuilt scheduler. This allows the item to be set to trigger at certain time: once a day, on certain days of the week, certain weeks of the month and so on. Note that when a schedule fires it does not guarantee that action will be taken - just that the item will have an opportunity to do its thing. If the item requires a target window to be present, and a suitable target isn't there, then the opportunity will be lost and no action will be taken until the next "slot" comes around.

Note#1: Schedules can only fire when PTFB is enabled and in "watching" mode. If a schedule is set to trigger when the main window is open, it will be ignored.

Note#2: The next trigger time is calculated from the previous trigger time, if available. If you modify the schedule, the record of the previous trigger time will be erased.

By Hotkey (default off)

You can define a hotkey for running an item manually. The hot key will work whether PTFB is in watch mode or sitting open on the screen.

Take care when choosing the key combination - there are certain keys that are normally reserved for common Windows functions. You can claim some of these as a hotkey, but doing so could lead to confusion for you, and for others (if your PC is shared).

Additionally, please be aware that Windows allocates hotkeys on a first come, first served basis. If you've set another program to use a particular hotkey, it'll likely prevent PTFB from using the same hotkey. Currently there is no way of getting Windows to give you an overview of hotkey assignments (more's the pity).

By Command Line (default on)

Each single-press and macro item in PTFB has its own unique four-digit code. If you run PTFB from the command line with up to two of these codes (separated by a single space), PTFB will trigger them almost instantly. The code for each item is shown opposite the "By Command Line" option, along with an example command line. You can select the sample line and copy it to the clipboard if you wish.

It doesn't matter whether PTFB is already running or not. If you get the command line right, and PTFB's window is not currently open (or disabled) then the appropriate item(s) will be given an opportunity to run. Of course, if the required target window is not present, then nothing will happen!

So, how could you use this?

Well, if you don't like PTFB's inbuilt scheduling options, why not use your own preferred scheduling program? Just give it the command line shown here, set the required schedule, and you're done. That's just one example. Developers and administrators can use the command line to tie PTFB in to their various scripts and processes, ensuring that the actions only occur when they're needed.

Note#1: If PTFB is already running when the command line is issued, it must be in the watching state (main window not showing) or the command will be ignored.

Note#2: If PTFB is not running when the command is issued, it will trigger the required item but keep running afterwards. If you want PTFB to only run an item in response to the command line, just untick all the trigger options except By Command Line.

By Macro Run Command (default on)

This is only available for macro items.

When editing a macro, you can insert a special command to run another macro. This will only have an effect if the "By Macro" option is enabled - so unticking this is a quick way to disable a nested run command without having to re-edit the macro.

Note: When one macro is run within another, its notifications (if any) do not run. Only the notifications associated with the outer macro can fire.

 

Repeat Options

By default, PTFB will act only once on each target. If you tick the Repeat box, you allow PTFB to act repeatedly on the same target regardless of how it was triggered.

CAUTION: Think carefully before enabling repeat with a zero second delay, especially with single-press items! If PTFB is busy pressing a button 50 times a second, you won't get much chance to regain control of the mouse!

If you're going to do this, please setup a hotkey to disable PTFB or open its Window first. You can do this via the General page of the configuration screen.

Otherwise, your only recourse may be to hit CTRL-ALT_DELETE and use task manager to open another copy of PTFB. This causes PTFB to open its main window and halt its activities.


TIP#1: If you find yourself always having to change the trigger options when you create a new macro, don't forget that you can alter the defaults - check out the "Defaults" page of PTFB's Configuration Sheet for more details.

TIP#2: "Trigger When Target Window Appears" is still available for screen-based macros, but since there is no target window as such, the macro will always want to fire as soon as you click the "Start Watching" button. It's more common to disable this trigger option for this type of macro, and use one of the other triggers instead (typically the hotkey trigger).

TIP#3: The repeat options apply to all triggers. If you want the repeat options to be different depending on the trigger type, you'll have to create a copy of the single-press or macro and adjust its triggers and repeat options appropriately. There's a quick way to create a copy of an existing item - just right-click it in the main list and choose "Duplicate" from the resulting menu.